//
//  HomeFloorModel.swift
//  XMYouPin
//
//  Created by 王宗成 on 2019/7/3.
//  Copyright © 2019 王宗成. All rights reserved.
//

import UIKit
import HandyJSON
class HomeFloorModel:NSObject, HandyJSON {

    var floor_id:String?
    var height:CGFloat = 0
    
    @objc dynamic var module_key:String? {
        
        didSet
        {
           
            switch self.module_key {
            case "banner":
                let rate:CGFloat =  1080.0/450.0
                self.height = kScreenW/rate
                
            case "kingkong_activity":
                self.height = 80*kHeightRatio
            case "recommend":
                self.height = 260*kHeightRatio+3*3
            case "crowd_funding":
                self.height = (64+140*2)*kHeightRatio
            case "single_image":
                let rate:CGFloat =  1080.0/210.0
                self.height = (kScreenW - 2*0)/rate + 20
            case "plaza":
                let rate:CGFloat =  244.0/363.0
                let width:CGFloat = (kScreenW-5*3)/4
                
                self.height = width/rate * 2 + 3*3
                
            default:
                let rate:CGFloat =  1080.0/840.0
                let width:CGFloat = kScreenW
                
                self.height = width/rate
            }
        }
    }
    var config:ConfigModel?
    var data:HomeDataModel?
    
    required override init() {
        
    }
}
